#include "stdafx.h"
#include "FileDeviceHandleLibrary.h"
#include "../vfs/FileDescriptorLibrary.h"

namespace ja2{ namespace vfs
{
		FileDescriptorLibrary::FileDescriptorLibrary(long long Begin, long long End, boost::filesystem::path const &Name, std::ifstream *pStream)
			: FileDescriptor(Name), m_Begin(Begin), m_End(End), m_pStream(pStream)
		{
		}

		FileDeviceHandlePtr_t FileDescriptorLibrary::do_get_file_handle(std::ios_base::openmode /*Mode*/) const
		{
			return FileDeviceHandlePtr_t(new FileDeviceHandleLibrary(*m_pStream, get_file_name().string(), m_Begin, m_End));
		}
} /*vfs*/} /*ja2*/